import { http } from '@/utils/request'
import type { Performance, PaginatedResponse, ApiResponse } from '@/types'

// 获取演出列表
export const getPerformanceList = (params?: {
  page?: number;
  limit?: number;
  date?: string;
  venue?: string;
  status?: string;
}): Promise<ApiResponse<PaginatedResponse<Performance>>> => {
  return http.get('/client/performances', { params })
}

// 获取演出详情
export const getPerformanceDetail = (id: string | number): Promise<ApiResponse<Performance>> => {
  return http.get(`/client/performances/${id}`)
}

// 获取演出倒计时
export const getPerformanceCountdown = (id: string | number): Promise<ApiResponse<{
  countdown: string;
  status: string;
}>> => {
  return http.get(`/client/performances/${id}/countdown`)
}

// 获取艺人演出列表
export const getArtistPerformances = (artistId: string | number): Promise<ApiResponse<PaginatedResponse<Performance>>> => {
  return http.get(`/client/artists/${artistId}/performances`)
}

// 搜索演出
export const searchPerformances = (keyword: string): Promise<ApiResponse<Performance[]>> => {
  return http.get('/client/performances/search', { params: { q: keyword } })
} 